import requests

# 目标接口地址
url = "http://localhost:8080/orders/upload"  # 修改为你的实际接口路径

# 登录后获得的 Authorization Token（Bearer 或直接写 token）
headers = {
    "Authorization": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiOWQ1MzNmMjAtMzEwZS00Yzk3LWE0ZTMtMzkwYTNiNzY0ZjA1In0.J5zWLgMukrhJXA3gfon4EYDlZHqIZGaJrgwEpQWu1MOKdngfPJFm8I873GNoDkrY0g6vDQArHtVi073zaV0Ajw"
}

# 要上传的 Excel 文件路径
file_path = "file/test.xlsx"

# 构建上传文件数据
files = {
    "file": ("test.xlsx", open(file_path, "rb"), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
}

# 发送 POST 请求
response = requests.post(url, headers=headers, files=files)

# 输出结果
print("Status Code:", response.status_code)
print("Response JSON:", response.json())
